<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Bronya
  Date: 2022/11/28
  Time: 23:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>

            /* 设置表格边框，单元格的线的粗细，颜色 */
        table,td {
            border: 1px solid black;
        }
        /* 设置 表格边框线与单元格的线折叠*/
        table {
            border-collapse: collapse;
        }
        /* 设置 表格宽度和高度 */

        /* 设置 单元格文本水平和垂直对齐方式 */
        td {
            text-align: center;
            vertical-align: center;
        }
        /* 设置 单元格文本与单元格边框的距离 */
        td {
            padding: 15px;
        }
        th{width: 200px}
    </style>

</head>
<%@include file="menu.jsp"%>
<body>
<div style="position: absolute;top: 60px">
    <form method="post" action="/selectBookByBook_id">
        搜索<input type="text" name="book_id">
    </form>
</div>
<div style="position: absolute;top: 60px;left: 300px">
    <form method="post" action="/toaddbook">
        <input type="submit" value="增加书籍">
    </form>
</div>
<div style="position: absolute;top: 100px" >
<table>
    <tr>
        <td>编号</td>
        <td>类型</td>
        <td>书名</td>
        <td>出版社</td>
        <td>作者</td>
        <td>页数</td>
        <td>日期</td>
        <td>价格</td>
        <td>数量</td>
        <td>图片</td>
        <td>梗概</td>
        <td>操作</td>
    </tr>

        <c:forEach items="${books}" var="book">
            <tr>
                <td>${book.book_id}</td>
                <td>${book.type}</td>
                <td>${book.name}</td>
                <td>${book.publisher}</td>
                <td>${book.author}</td>
                <td>${book.page}</td>
                <td>${book.date}</td>
                <td>${book.price}</td>
                <td>${book.quantity}</td>
                <td>${book.image}</td>
                <td>${book.detail}</td>
                <td>
                    <a href="/toupdate_book?book_id=${book.book_id}">修改</a>
                    <a href="/deleteBookByBook_id?book_id=${book.book_id}">删除</a>
                </td>
            </tr>
    </c:forEach>

</table>
</div>
</body>
</html>
